/*
 * 英才汇硕信息科技有限公司 拥有本软件版权 2021 并保留所有权利。
 * Copyright 2021, YCHS Information&Science Technology Co.,Ltd,
 * All rights reserved.
 */
package com.tyust.lawyermanager.dongao.service;

import com.tyust.lawyermanager.dongao.entity.Lawyer;
import com.tyust.lawyermanager.dongao.mapper.LawyerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 律师业务接口实现类
 * @author licaixia
 * @version 1.0
 * @date 2023/1/4
 */
@Service
public class LawyerServiceImpl implements LawyerService {
    @Autowired
    LawyerMapper lawyerMapper;

    /**
     * 查询所有律师
     * @return 律师集合
     */
    @Override
    public List<Lawyer> findLawyer(){
        return lawyerMapper.selectLawyer();
    }

    /**
     * 删除律师
     *
     * @param lawyerid 律师编号
     * @return
     */
    @Override
    public int removeLawyer(int lawyerid) {
        return lawyerMapper.deleteLawyer(lawyerid);
    }

    /**
     * 添加律师
     *
     * @param lawyer 包含律师信息对象
     * @return 1：添加成功；0：失败
     */
    @Override
    public int addLawyer(Lawyer lawyer) {
        return lawyerMapper.insertLawyer(lawyer);
    }
}
